package academia.gui;

import java.awt.EventQueue;

import javax.swing.JInternalFrame;

import java.awt.SystemColor;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JFrame;
import javax.swing.JLabel;

import java.awt.Font;

import javax.swing.JButton;


import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.LayoutStyle.ComponentPlacement;
import java.awt.Window.Type;
import java.awt.Dialog.ModalExclusionType;
import java.awt.Toolkit;
import java.awt.Color;

import java.text.ParseException;

import java.text.ParseException;
import java.util.logging.Level;
import java.util.logging.Logger;


public class MenuRoot extends JFrame {

	/**
	 * Launch the application.
	 */
	

	/**
	 * Create the frame.
	 */
	public MenuRoot() {
		setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\En\u00E9ias\\Desktop\\Academia\\background01.jpg"));
		setAlwaysOnTop(true);
		setTitle("Menu");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		getContentPane().setBackground(SystemColor.inactiveCaptionBorder);
		
		JLabel lblRootMenu = new JLabel("Root Menu");
		lblRootMenu.setBounds(159, 30, 103, 26);
		lblRootMenu.setForeground(SystemColor.controlShadow);
		lblRootMenu.setFont(new Font("Dialog", Font.BOLD, 20));
		
		JButton btnCadastrarInstrutor = new JButton("Cadastrar Instrutor");
		btnCadastrarInstrutor.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				new CadastroInstrutor().setVisible(true);
				dispose();
			}
		});
		btnCadastrarInstrutor.setFont(new Font("Tahoma", Font.BOLD, 11));
		btnCadastrarInstrutor.setForeground(SystemColor.text);
		btnCadastrarInstrutor.setBackground(new Color(152, 251, 152));
		btnCadastrarInstrutor.setBounds(25, 94, 165, 23);
		
		JButton btnSair = new JButton("Tela Inicial");
		
	    JButton btnCadastrarCliente = new JButton("Cadastrar Cliente");
		btnCadastrarCliente.setFont(new Font("Tahoma", Font.BOLD, 11));
		btnCadastrarCliente.setForeground(SystemColor.text);
		btnCadastrarCliente.setBackground(new Color(152, 251, 152));
		btnCadastrarCliente.setBounds(25, 142, 165, 23);
		btnCadastrarCliente.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {				

				try {
					new CadastroCliente().setVisible(true);
				} catch (ParseException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}

                            try {
                                new CadastroCliente().setVisible(true);
                            } catch (ParseException ex) {
                                Logger.getLogger(MenuRoot.class.getName()).log(Level.SEVERE, null, ex);
                            }

				dispose();
			}
		});
		
		
		btnSair.setForeground(SystemColor.text);
		btnSair.setFont(new Font("Tahoma", Font.BOLD, 11));
		btnSair.setBackground(SystemColor.inactiveCaption);
		btnSair.setBounds(135, 210, 165, 23);
		btnSair.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				new TelaInicio().setVisible(true);
				dispose();
			}
		});
		getContentPane().setLayout(null);
		getContentPane().add(btnCadastrarInstrutor);
		getContentPane().add(btnCadastrarCliente);
		getContentPane().add(lblRootMenu);
		getContentPane().add(btnSair);
		
		JButton btnCadastrados = new JButton("Usuarios Cadastrados");
		btnCadastrados.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				new Cadastrados().setVisible(true);
				dispose();
			}
		});
		btnCadastrados.setForeground(Color.WHITE);
		btnCadastrados.setFont(new Font("Tahoma", Font.BOLD, 11));
		btnCadastrados.setBackground(new Color(211, 211, 211));
		btnCadastrados.setBounds(237, 94, 171, 23);
		getContentPane().add(btnCadastrados);
		
		JButton btnBuscar = new JButton("Buscar Usuario");
		btnBuscar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				new TelaBusca().setVisible(true);
				dispose();
			}
		});
		btnBuscar.setForeground(Color.WHITE);
		btnBuscar.setFont(new Font("Tahoma", Font.BOLD, 11));
		btnBuscar.setBackground(new Color(211, 211, 211));
		btnBuscar.setBounds(237, 142, 171, 23);
		getContentPane().add(btnBuscar);
		setBounds(100, 100, 450, 300);

	}
	
}
